package com.xuan.yrmanage.common.exception;


import com.xuan.yrmanage.common.response.ResultCode;

/**
 * FileName: CustomException
 * Author:   xuan zongjun
 * Date:     2020/2/26 8:52
 * Description:
 */

//继承runtimeException 对代码没有侵入
public class CustomException extends RuntimeException {
    //错误代码
    private ResultCode resultCode;

    public CustomException(ResultCode resultCode) {
        //异常信息为错误代码+异常信息
        super("错误代码："+resultCode.code()+",错误信息："+resultCode.message());
        this.resultCode = resultCode;
    }

    public ResultCode getResultCode() {
        return this.resultCode;
    }

}
